package com.qf.springboot.rabbitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TopicSender {

	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void send() {
		String msg1 = "I am topic.mesaage msg======";
		System.out.println("sender1 : " + msg1);
		this.rabbitTemplate.convertAndSend("exchange", "topic.message", msg1);
		String msg2 = "I am topic.mesaages msg########";
		System.out.println("sender2 : " + msg2);
		this.rabbitTemplate.convertAndSend("exchange", "topic.messages", msg2);
	}
}
